﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using JXMSTC2.Model;
using JXMSTC2.Control;

public partial class InfoManage_UserControl_cColumnManageList : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!Page.IsPostBack)
        {
            BindGridView();
        }
    }



    #region 显示列表的数据绑定
    /// <summary>
    /// 数据绑定
    /// </summary>
    public void BindGridView()
    {
        string where                    = "";
        this.grvColumnList.DataSource = DbHelperSQL.GetPagenumberData(pager, "InfoCategory", "Pk_InfoCategoryId", "Pk_InfoCategoryId desc", "*", where, Convert.DBNull.ToString(), labPager);
        this.grvColumnList.DataBind();
    }
    #endregion



    #region 列表的行命令方法
    /// <summary>
    /// 列表的行命令方法
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void grvColumnList_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "DeleteInfo")
        {
            InfoCategoryModelControl infoact = new InfoCategoryModelControl();
            infoact.Delete(int.Parse(e.CommandArgument.ToString()));
            MessageBox.ShowAndRedirect(Page, "信息删除成功", "ColumnManageList.aspx");
        }
    }
    #endregion


    #region 页面控件的方法
    /// <summary>
    /// 页面编号更改激发的事件
    /// </summary>
    /// <param name="src"></param>
    /// <param name="e"></param>
    protected void pager_PageChanged(object src, Wuqi.Webdiyer.PageChangedEventArgs e)
    {
        pager.CurrentPageIndex = e.NewPageIndex;
        BindGridView();
    }
    #endregion
}
